home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group95b.txt / 000051_icon-group-sender _Sun Jun 18 16:09:07 1995.msg < prev    next >
Internet Message Format  |  1995-09-18  |  5KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 19 Jun 1995 09:02:35 MST
  2. To: icon-group@cs.arizona.edu
  3. Date: 18 Jun 1995 16:09:07 +0100
  4. From: ian@pipex.net (Ian Phillipps)
  5. Message-Id: <3s1fij$7r9@pipe.pipex.net>
  6. Organization: PIPEX, 216 Science Park, Cambridge, England
  7. Sender: icon-group-request@cs.arizona.edu
  8. References: <1995Jun16.172604.22642@leeds.ac.uk>, <1995Jun17.174319.29735@nmt.edu>
  9. Subject: Re: Perl v. Icon
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. In article <1995Jun17.174319.29735@nmt.edu>, John Shipman <john@nmt.edu> wrote:
  13. >I've been a heavy Icon user for a year or so now, and I think
  14. >it's a good choice for text processing applications, especially
  15. >when you need a good selection of data structures.
  16.  
  17. OK, I'm a heavy perl programmer (not that heavy for my height, though).
  18. A couple of years ago I looked fairly closely at Icon, and elected to
  19. remain with Perl.
  20.  
  21. With Perl 4 and earlier, the weak point was, as John implies, data
  22. structures, although the split and join operators provided quite
  23. convenient workarounds.
  24.  
  25. Judging what I remember of Icon (version 8, I think) and perl 5, here's
  26. my assessment of relative strengths: (P=Perl stronger, I=Icon stronger)
  27.  
  28. P    Online documentation (Full icon docs are only available as a
  29.     conventional book)
  30.  
  31. PPP    Regular expressions. This is the biggie as far as I'm concerned.
  32.     The sort of job where you're trying to parse incoming data which
  33.     has a slightly unknown syntax.  By comparison, the Icon method
  34.     of lots of operators to scan across a string is seriously
  35.     clunky.  (BTW the date I finally gave up on Icon is when I read
  36.     in the Icon newsletter that Ralph Griswold was never going to
  37.     put REs into Icon)
  38.  
  39. -    List structures
  40.  
  41. I    List processing. The list-traversal primitives of Icon are still
  42.     better that those of Perl. Things like lazy evaluation fall
  43.     directly out of Icon syntax.
  44.  
  45. ?    Syntax. I don't agree that Perl syntax is ugly, at least no more
  46.     than any other computer language. It's unconventional,
  47.     certainly, to put "$" before all scalars. But after a very short
  48.     while you know that "$" means it's a scalar, and is helpful.
  49.     Icon's use of syntax "looks cleaner" but is, if anything, rather
  50.     more unconventional. This is another area where Perl 5 has
  51.     made a difference.
  52.  
  53. P    Support. I don't currently subscribe to comp.lang.icon, but
  54.     you'd be hard put to it to find a friendlier place to ask daft
  55.     questions than comp.lang.perl.misc (new name..). Oh, and get
  56.     answers :-). C.l.p postings outnumber c.l.i. postings by around
  57.     30 to 1, not that that proves anything.
  58.  
  59. I?    Icon has a two-phase interpretation process, which is cumbersome
  60.     for quick one-shot programs, but a payoff for bigger ones.
  61.     (I think you can work round this by using "eval", but I don't
  62.     really remember).
  63.  
  64. I    Co-expressions. This is a very powerful paradigm - a
  65.     generalisation of co-routines - built into the Icon
  66.     language (although at the time I could only really play on DOS
  67.     and was greeted with "co-expressions not implemented").
  68.  
  69. P    The full specification of perl and its libraries is available
  70.     on-line. "You can't search dead trees".
  71.  
  72. >The input is a list of skills (C++, hardware repair, etc.),
  73. >structured as a three-level hierarchy (major category, minor
  74. >category, and skill name), with each skill followed by a list
  75. >of people who have that skill, and a rating of B for beginner,
  76. >I for intermediate, and E for expert.
  77.  
  78. Hmm.. I'd give this project around 2-3 days in perl, at the most.
  79. [Resists temptation to include perl solution in posting :-)]
  80.  
  81. >applications will need.  Although Icon is not technically an
  82. >object-oriented language, I can still get the kind of
  83. >encapsulation and abstraction that I need.
  84.  
  85. If we were comparing Icon with perl 4, I'd vote for Icon on this. Perl 5
  86. levels this playing field.
  87.  
  88. >to person.  The Icon concept of generators gives me a foolproof
  89. >way to allow the caller to visit each child of a parent node, for
  90. >example, without having to worry about how the tree is
  91. >structured.
  92.  
  93. >As a further disclaimer, I'm rather manic about good style.  I
  94. >want my programs to be legible, and I find that Icon gives me
  95. >a very natural expression of the problem.  I also find that
  96. >modifying programs is straightforward.
  97.  
  98. A danger with any powerful language is that it can be too concise for
  99. its own good. While neither Perl nor Icon can compete with APL in this
  100. league, it's possible to write exceedingly cryptic programs in each.
  101. Or in any programming language, for that matter (see
  102. ftp://gatekeeper.dec.com/.8/misc/ioccc/1988/phillipps.c, for instance)
  103. It's a programmer's job to explain what's not obvious - the problem is
  104. to remember what that is!
  105.  
  106. Generators are nice - if you know what's going on. If not, they can be
  107. very puzzling, since the paradigm is unique to Icon.
  108.  
  109. >Since I discovered Icon, I have written negligible amounts of C,
  110. >and nothing in Awk.  Most of my work involves transformation of
  111. Sounds like my experience with Perl :-)
  112.  
  113. >text input files into text output files (although I have done a
  114. >little work with portable binary encodings in files), and I'd say
  115. >I'm three times as productive as with C and twice Awk.
  116.  
  117. Hmm.. I'd be surprised if awk were only twice as good as C in its
  118. domain. For text-bashing, I'd put the C:awk:perl ratio at 1:3-10:8
  119. The awk figure depends heavily on whether you have to work-around the
  120. limits in it.
  121.  
  122. Ian
  123.